<?php ob_start(); ?> 
<?php header ('Content-type: text/xml; charset=utf-8'); ?>     

<?php session_start(); ?>

<?php

function nameInUse($q)
{
  if (isset($q)){
    switch(strtolower($q))
    {
      case  'drew' :
          return '1';
          break;
      case  'fred' :
          return '1';
          break;
      default:
          return '0';
    }
  }else{
    return '0';
  }

}
?>

<response>
  <method>checkName</method>
  <result><?php
    echo nameInUse($_GET['q']) ?>
  </result>
</response>